home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 24 / Mac Magazin and MacEasy Magazine CD - Issue 24.iso / Grafik & Text / Microsoft Installer Patch / notify.c < prev    next >
Text File  |  1995-12-23  |  622b  |  29 lines

  1. // notify.c
  2.  
  3. #include "notify.h"
  4.  
  5. void UserNotify( StringPtr s )
  6. {
  7.     NMRecPtr    notify = nil;
  8.     StringPtr    nmStr = nil;
  9.     
  10.     // allocate buffer to hold notification record
  11.     notify = (NMRecPtr) NewPtrSysClear(sizeof(NMRec) + sizeof(Str255));
  12.     if (!notify) { SysBeep(12); return; }
  13.     
  14.     // fill in the string
  15.     nmStr = (StringPtr)notify + sizeof(NMRec);
  16.     BlockMoveData( s, nmStr, s[0]+1 );
  17.     
  18.     // and the rest of the fields
  19.     notify->qLink    = 0;
  20.     notify->qType    = nmType;
  21.     notify->nmMark    = 0;
  22.     notify->nmIcon    = 0;
  23.     notify->nmSound    = (Handle) -1;
  24.     notify->nmStr    = nmStr;
  25.     notify->nmResp    = (NMUPP)-1;
  26.     
  27.     // and do it
  28.     NMInstall( notify );
  29. }